#include <gui/infopage_screen/InfoPageView.hpp>

InfoPageView::InfoPageView()
{

}

void InfoPageView::setupScreen()
{
    InfoPageViewBase::setupScreen();
}

void InfoPageView::tearDownScreen()
{
    InfoPageViewBase::tearDownScreen();
}
//更新温湿度、光照度数据
void InfoPageView::updateInfo(float newHum, float newTem, uint16_t newALS)
{
		//更新湿度
		Unicode::snprintfFloat(textHumidityBuffer, TEXTHUMIDITY_SIZE, "%.1f",newHum);
	  textHumidity.invalidate();
		//更新温度
		Unicode::snprintfFloat(textTempBuffer, TEXTTEMP_SIZE, "%.1f",newTem);
	  textTemp.invalidate();
		//更新光强度
		Unicode::snprintf(textALSBuffer, TEXTALS_SIZE, "%05d",newALS);
	  textALS.invalidate();
}
//页面跳转
void InfoPageView::InfoPageChange(uint8_t newFiveKeyFunc)
{
		handleKeyEvent(newFiveKeyFunc);
}